package com.unionpay.bean;

import java.util.List;

import org.codehaus.jackson.annotate.JsonWriteNullProperties;

import com.unionpay.config.Config;

/**
 * 接口输出对象
 * 
 * @author liuzy
 * @since 2016年4月29日
 */
@SuppressWarnings("deprecation")
public class Response {
	private String responseCode = "1";
	private String errorCode = "";
	private String errorMessage = "";
	private Data response = new Data();

	public String getResponseCode() {
		return responseCode;
	}

	public void setResponseCode(String responseCode) {
		this.responseCode = responseCode;
	}

	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public Data getResponse() {
		return response;
	}

	public void setResponse(Data response) {
		this.response = response;
	}

	@JsonWriteNullProperties(false)
	public class Data {
		private String blockHash;
		private String blockNumber;
		private String content;
		private String transactionIndex;
		private String transactionid;
		private String txid;
		private String anchorconfigid;
		private String paramtype;
		private String startdate;
		private String anchorinterval;
		private String anchorrecords;
		private String createdate;
		private List<String> transactionids;
		private List<String> contents;

		private String ethereumVersion;
		private String clientVersion;
		private String netVersion;
		private String listening;
		private List<String> allaccounts;
		private String peercount;
		private List<String> peeraddress;
		private Object result;
		private String hashRate;
		private String rewardAccount;
		private String blocknumber;

		private String parentHash;
		private String minerAddr;
		private String difficulty;
		private String totalDifficulty;
		private String extraData;
		private String blockSize;
		private String gasLimit;
		private String gasUsed;
		private String transactionHash;
		private String accTransactionCount;
		private String transactionNumber;
		
		
		public String getTransactionNumber() {
			return transactionNumber;
		}

		public void setTransactionNumber(String transactionNumber) {
			this.transactionNumber = transactionNumber;
		}

		public String getAccTransactionCount() {
			return accTransactionCount;
		}

		public void setAccTransactionCount(String accTransactionCount) {
			this.accTransactionCount = accTransactionCount;
		}

		public String getParentHash() {
			return parentHash;
		}

		public void setParentHash(String parentHash) {
			this.parentHash = parentHash;
		}

		public String getMinerAddr() {
			return minerAddr;
		}

		public void setMinerAddr(String minerAddr) {
			this.minerAddr = minerAddr;
		}

		public String getDifficulty() {
			return difficulty;
		}

		public void setDifficulty(String difficulty) {
			this.difficulty = difficulty;
		}

		public String getTotalDifficulty() {
			return totalDifficulty;
		}

		public void setTotalDifficulty(String totalDifficulty) {
			this.totalDifficulty = totalDifficulty;
		}

		public String getExtraData() {
			return extraData;
		}

		public void setExtraData(String extraData) {
			this.extraData = extraData;
		}

		public String getBlockSize() {
			return blockSize;
		}

		public void setBlockSize(String blockSize) {
			this.blockSize = blockSize;
		}

		public String getGasLimit() {
			return gasLimit;
		}

		public void setGasLimit(String gasLimit) {
			this.gasLimit = gasLimit;
		}

		public String getGasUsed() {
			return gasUsed;
		}

		public void setGasUsed(String gasUsed) {
			this.gasUsed = gasUsed;
		}

		public String getTransactionHash() {
			return transactionHash;
		}

		public void setTransactionHash(String transactionHash) {
			this.transactionHash = transactionHash;
		}

		public String getBlocknumber() {
			return blocknumber;
		}

		public void setBlocknumber(String blocknumber) {
			this.blocknumber = blocknumber;
		}

		public String getRewardAccount() {
			return rewardAccount;
		}

		public void setRewardAccount(String rewardAccount) {
			this.rewardAccount = rewardAccount;
		}

		public String getHashRate() {
			return hashRate;
		}

		public void setHashRate(String hashRate) {
			this.hashRate = hashRate;
		}

		public Object getResult() {
			return result;
		}

		public void setResult(Object result) {
			this.result = result;
		}

		public String getPeercount() {
			return peercount;
		}

		public void setPeercount(String peercount) {
			this.peercount = peercount;
		}

		public List<String> getPeeraddress() {
			return peeraddress;
		}

		public void setPeeraddress(List<String> peeraddress) {
			this.peeraddress = peeraddress;
		}

		public List<String> getAllaccounts() {
			return allaccounts;
		}

		public void setAllaccounts(List<String> allaccounts) {
			this.allaccounts = allaccounts;
		}

		public String getEthereumVersion() {
			return ethereumVersion;
		}

		public void setEthereumVersion(String ethereumVersion) {
			this.ethereumVersion = ethereumVersion;
		}

		public String getClientVersion() {
			return clientVersion;
		}

		public void setClientVersion(String clientVersion) {
			this.clientVersion = clientVersion;
		}

		public String getNetVersion() {
			return netVersion;
		}

		public void setNetVersion(String netVersion) {
			this.netVersion = netVersion;
		}

		public String getListening() {
			return listening;
		}

		public void setListening(String listening) {
			this.listening = listening;
		}

		public String getBlockHash() {
			return blockHash;
		}

		public void setBlockHash(String blockHash) {
			this.blockHash = blockHash;
		}

		public String getBlockNumber() {
			return blockNumber;
		}

		public void setBlockNumber(String blockNumber) {
			this.blockNumber = blockNumber;
		}

		public String getContent() {
			return content;
		}

		public void setContent(String content) {
			this.content = content;
		}

		public String getTransactionIndex() {
			return transactionIndex;
		}

		public void setTransactionIndex(String transactionIndex) {
			this.transactionIndex = transactionIndex;
		}

		public String getTransactionid() {
			return transactionid;
		}

		public void setTransactionid(String transactionid) {
			this.transactionid = transactionid;
		}

		public String getTxid() {
			return txid;
		}

		public void setTxid(String txid) {
			this.txid = txid;
		}

		public String getAnchorconfigid() {
			return anchorconfigid;
		}

		public void setAnchorconfigid(String anchorconfigid) {
			this.anchorconfigid = anchorconfigid;
		}

		public String getParamtype() {
			return paramtype;
		}

		public void setParamtype(String paramtype) {
			this.paramtype = paramtype;
		}

		public String getStartdate() {
			return startdate;
		}

		public void setStartdate(String startdate) {
			this.startdate = startdate;
		}

		public String getAnchorinterval() {
			return anchorinterval;
		}

		public void setAnchorinterval(String anchorinterval) {
			this.anchorinterval = anchorinterval;
		}

		public String getAnchorrecords() {
			return anchorrecords;
		}

		public void setAnchorrecords(String anchorrecords) {
			this.anchorrecords = anchorrecords;
		}

		public String getCreatedate() {
			return createdate;
		}

		public void setCreatedate(String createdate) {
			this.createdate = createdate;
		}

		public List<String> getTransactionids() {
			return transactionids;
		}

		public void setTransactionids(List<String> transactionids) {
			this.transactionids = transactionids;
		}

		public List<String> getContents() {
			return contents;
		}

		public void setContents(List<String> contents) {
			this.contents = contents;
		}

	}

	public void setError(String code) {
		this.setResponseCode("0");
		this.setErrorCode(code);
		this.setErrorMessage(Config.statuscodeMap.get(code));
	}
}
